﻿'
' Will Strohl (will.strohl@gmail.com)
' http://www.willstrohl.com
'
'Copyright (c) 2011, Will Strohl
'All rights reserved.
'
'Redistribution and use in source and binary forms, with or without modification, are 
'permitted provided that the following conditions are met:
'
'Redistributions of source code must retain the above copyright notice, this list of 
'conditions and the following disclaimer.
'
'Redistributions in binary form must reproduce the above copyright notice, this list 
'of conditions and the following disclaimer in the documentation and/or other 
'materials provided with the distribution.
'
'Neither the name of Will Strohl nor the names of its contributors may be 
'used to endorse or promote products derived from this software without specific prior 
'written permission.
'
'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
'EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
'OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
'SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
'INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
'TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
'BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
'CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
'ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
'DAMAGE.
'

Imports System
Imports DotNetNuke

Namespace WillStrohl.Modules.CodeCamp

    Public MustInherit Class DataProvider

#Region " Private Members "

        Private Const c_Object As String = "data"
        Private Const c_ObjectType As String = "WillStrohl.Modules.CodeCamp"

#End Region

#Region " Shared/Static Methods "

        ' singleton reference to the instantiated object 
        Private Shared objProvider As DataProvider = Nothing

        ' constructor
        Shared Sub New()
            CreateProvider()
        End Sub

        ' dynamically create provider
        Private Shared Sub CreateProvider()
            objProvider = CType(Framework.Reflection.CreateObject(c_Object, c_ObjectType, c_ObjectType), DataProvider)
        End Sub

        ' return the provider
        Public Shared Shadows Function Instance() As DataProvider
            Return objProvider
        End Function

#End Region

#Region " Abstract Methods "

        Public MustOverride Function AddCodeCamp(ByVal ModuleId As Integer, ByVal Title As String, ByVal Description As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal IconFile As String, ByVal AltText As String, ByVal RoleName As String, ByVal WaitListRoleName As String, ByVal MaximumCapacity As Integer, ByVal RegistrationActive As Boolean, ByVal ShowShirtSize As Boolean, ByVal ShowMicrosoftMVP As Boolean, ByVal ShowAuthor As Boolean, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateCodeCamp(ByVal CodeCampId As Integer, ByVal ModuleId As Integer, ByVal Title As String, ByVal Description As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal IconFile As String, ByVal AltText As String, ByVal RoleName As String, ByVal WaitListRoleName As String, ByVal MaximumCapacity As Integer, ByVal NumberRegistered As Integer, ByVal EventFull As Boolean, ByVal RegistrationActive As Boolean, ByVal ShowShirtSize As Boolean, ByVal ShowMicrosoftMVP As Boolean, ByVal ShowAuthor As Boolean, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteCodeCamp(ByVal CodeCampId As Integer)
        Public MustOverride Function GetCodeCampById(ByVal CodeCampId As Integer) As IDataReader
        Public MustOverride Function GetCodeCampByModule(ByVal ModuleId As Integer) As IDataReader
        Public MustOverride Function GetCodeCamps() As IDataReader
        Public MustOverride Function GetCodeCampsFutureSorted() As IDataReader
        Public MustOverride Sub EnableCodeCamp(ByVal CodeCampId As Integer, ByVal Enable As Boolean)

        Public MustOverride Function AddRegistration(ByVal CodeCampId As Integer, ByVal UserId As Integer, ByVal ShirtSize As String) As Integer
        Public MustOverride Sub UpdateRegistration(ByVal RegistrationId As Integer, ByVal CodeCampId As Integer, ByVal UserId As Integer, ByVal ShirtSize As String)
        Public MustOverride Sub DeleteRegistration(ByVal RegistrationId As Integer)
        Public MustOverride Function GetRegistrationById(ByVal RegistrationId As Integer) As IDataReader
        Public MustOverride Function GetRegistrationByUser(ByVal UserId As Integer) As IDataReader
        Public MustOverride Function GetRegistrations(ByVal CodeCampId As Integer) As IDataReader

        Public MustOverride Function AddVolunteer(ByVal RegistrationId As Integer, ByVal Notes As String) As Integer
        Public MustOverride Sub UpdateVolunteer(ByVal VolunteerId As Integer, ByVal RegistrationId As Integer, ByVal Notes As String)
        Public MustOverride Sub DeleteVolunteer(ByVal VolunteerId As Integer)
        Public MustOverride Function GetVolunteer(ByVal VolunteerId As Integer) As IDataReader
        Public MustOverride Function GetVolunteers(ByVal CodeCampId As Integer) As IDataReader

        Public MustOverride Function AddVolunteerTask(ByVal VolunteerId As Integer, ByVal Title As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateVolunteerTask(ByVal VolunteerTaskId As Integer, ByVal VolunteerId As Integer, ByVal Title As String, ByVal BeginDate As DateTime, ByVal EndDate As DateTime, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteVolunteerTask(ByVal VolunteerTaskId As Integer)
        Public MustOverride Function GetVolunteerTask(ByVal VolunteerTaskId As Integer) As IDataReader
        Public MustOverride Function GetVolunteerTasks(ByVal VolunteerId As Integer) As IDataReader

        Public MustOverride Function AddTimeSlot(ByVal CodeCampId As Integer, ByVal BeginTime As DateTime, ByVal EndTime As DateTime, ByVal AgendaText As String, ByVal SpanAllTracks As Boolean, ByVal IncludeInDropDowns As Boolean, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateTimeSlot(ByVal TimeSlotId As Integer, ByVal CodeCampId As Integer, ByVal BeginTime As DateTime, ByVal EndTime As DateTime, ByVal AgendaText As String, ByVal SpanAllTracks As Boolean, ByVal IncludeInDropDowns As Boolean, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteTimeSlot(ByVal TimeSlotId As Integer)
        Public MustOverride Function GetTimeSlot(ByVal TimeSlotId As Integer) As IDataReader
        Public MustOverride Function GetTimeSlots(ByVal CodeCampId As Integer) As IDataReader

        Public MustOverride Function AddSpeaker(ByVal RegistrationId As Integer, ByVal SpeakerName As String, ByVal CompanyTitle As String, ByVal CompanyName As String, ByVal URL As String, ByVal Bio As String, ByVal IconFile As String, ByVal MicrosoftMVP As Boolean, ByVal Author As Boolean, ByVal Approved As Boolean, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateSpeaker(ByVal SpeakerId As Integer, ByVal RegistrationId As Integer, ByVal SpeakerName As String, ByVal CompanyTitle As String, ByVal CompanyName As String, ByVal URL As String, ByVal Bio As String, ByVal IconFile As String, ByVal MicrosoftMVP As Boolean, ByVal Author As Boolean, ByVal Approved As Boolean, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteSpeaker(ByVal SpeakerId As Integer)
        Public MustOverride Function GetSpeaker(ByVal SpeakerId As Integer) As IDataReader
        Public MustOverride Function GetSpeakerByRegistrationId(ByVal RegistrationId As Integer) As IDataReader
        Public MustOverride Function GetSpeakerByUserId(ByVal UserId As Integer) As IDataReader
        Public MustOverride Function GetSpeakersBySession(ByVal SessionId As Integer) As IDataReader
        Public MustOverride Function GetSpeakersByCodeCamp(ByVal CodeCampId As Integer) As IDataReader
        Public MustOverride Function GetSpeakersByCodeCampAll(ByVal CodeCampId As Integer) As IDataReader
        Public MustOverride Sub ApproveSpeaker(ByVal SpeakerId As Integer, ByVal Approved As Boolean)

        Public MustOverride Function AddTrack(ByVal CodeCampId As Integer, ByVal Title As String, ByVal Description As String, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateTrack(ByVal TrackId As Integer, ByVal CodeCampId As Integer, ByVal Title As String, ByVal Description As String, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteTrack(ByVal TrackId As Integer)
        Public MustOverride Function GetTrack(ByVal TrackId As Integer) As IDataReader
        Public MustOverride Function GetTracks(ByVal CodeCampId As Integer) As IDataReader

        Public MustOverride Function AddSessionMinimal(ByVal SpeakerId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Function AddSession(ByVal SpeakerId As Integer, ByVal TrackId As Integer, ByVal TimeSlotId As Integer, ByVal RoomId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateSession(ByVal SessionId As Integer, ByVal SpeakerId As Integer, ByVal TrackId As Integer, ByVal TimeSlotId As Integer, ByVal RoomId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer)
        Public MustOverride Sub UpdateSessionMinimal(ByVal SessionId As Integer, ByVal SpeakerId As Integer, ByVal Title As String, ByVal Description As String, ByVal AudienceLevel As Integer, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteSession(ByVal SessionId As Integer)
        Public MustOverride Function GetSession(ByVal SessionId As Integer) As IDataReader
        Public MustOverride Function GetSessionsByTrack(ByVal TrackId As Integer) As IDataReader
        Public MustOverride Function GetSessionsByCodeCamp(ByVal CodeCampId As Integer) As IDataReader
        Public MustOverride Function GetSessionsBySpeakerId(ByVal SpeakerId As Integer) As IDataReader

        Public MustOverride Function AddRoom(ByVal CodeCampId As Integer, ByVal RoomName As String, ByVal Description As String, ByVal MaximumCapacity As Integer, ByVal CreatedByUser As Integer) As Integer
        Public MustOverride Sub UpdateRoom(ByVal RoomId As Integer, ByVal CodeCampId As Integer, ByVal RoomName As String, ByVal Description As String, ByVal MaximumCapacity As Integer, ByVal CreatedByUser As Integer)
        Public MustOverride Sub DeleteRoom(ByVal RoomId As Integer)
        Public MustOverride Function GetRoom(ByVal RoomId As Integer) As IDataReader
        Public MustOverride Function GetRoomsByCodeCamp(ByVal CodeCampId As Integer) As IDataReader

        Public MustOverride Function CodeCampCount() As Integer
        Public MustOverride Function CodeCampRoomCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function CodeCampTrackCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function CodeCampAttendeeCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function CodeCampSpeakerCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function CodeCampSessionCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function SpeakerSessionCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function TrackSessionCount(ByVal TrackId As Integer) As Integer
        Public MustOverride Function CodeCampVolunteerCount(ByVal CodeCampId As Integer) As Integer
        Public MustOverride Function CodeCampVolunteerTaskCount(ByVal CodeCampId As Integer) As Integer

#End Region

    End Class

End Namespace